package mc.support.taobao.api;

import mc.support.taobao.api.fields.GetShopInfoFields;
import com.taobao.api.TaobaoRequest;
import com.taobao.api.request.ShopGetRequest;
import com.taobao.api.response.ShopGetResponse;

/**
 * Created with IntelliJ IDEA. <br/>
 * Author: francis Yun    <br/>
 * Date: 2013-11-28  <br/>
 */
public class GetShopInfoReq extends AbstractReq<GetShopInfoReq, ShopGetResponse> {

    private String nick;

    private GetShopInfoFields fields;

    public GetShopInfoReq nick(String nick) {
        this.nick = nick;
        return this;
    }

    public GetShopInfoReq fields(GetShopInfoFields fields) {
        this.fields = fields;
        return this;
    }

    @Override
    protected TaobaoRequest toRequest() {
        ShopGetRequest req = new ShopGetRequest();
        if ( null != fields ) {
            req.setFields( fields.toString() );
        }
        if ( null != nick ) {
            req.setNick( nick );
        }
        return req;
    }

}
